Skip to content

docs: sync schemas and specs with source changes#5283

Merged
lpcox merged 3 commits into
mainfrom
docs/schema-sync-2026-06-19-f44e522d16eacfb9
Jun 19, 2026
Merged

docs: sync schemas and specs with source changes#5283
lpcox merged 3 commits into
mainfrom
docs/schema-sync-2026-06-19-f44e522d16eacfb9

Conversation

@github-actions

Copy link
Copy Markdown
Contributor

What changed

Two schema/spec files were out of sync with the implementation, found during analysis of commit 6de3216 (fix(api-proxy): 403 for terminal caps; fix Anthropic/Copilot input credits).

schemas/token-usage.schema.json — add 5 optional budget fields

mergeBudgetFields() in containers/api-proxy/token-tracker-shared.js conditionally writes five fields onto every token-usage JSONL record when budget tracking is active (apiProxy.maxEffectiveTokens or apiProxy.maxAiCredits):

Added field When present
ai_credits_this_response apiProxy.maxAiCredits configured
ai_credits_total apiProxy.maxAiCredits configured
effective_tokens_this_response apiProxy.maxEffectiveTokens configured
effective_tokens_total apiProxy.maxEffectiveTokens configured
model_multiplier apiProxy.maxEffectiveTokens configured

These are verified by token-tracker.schema.test.js (lines 300–407) but were absent from the schema, so consumers reading the schema for documentation were unaware of them. The schema already uses additionalProperties: true so records are not rejected at runtime, but the documentation was incomplete.

docs/awf-config-spec.md §5 — add missing CLI mapping row

apiProxy.maxCacheMisses--max-cache-misses <number> was missing from the §5 CLI-to-config mapping table. The config field (config-file.ts line 30), the schema entry (awf-config.schema.json line 147), and the CLI option (cli-options.ts line 357) all exist — only the spec table row was absent. Added between maxPermissionDenied and requestedModel in the sorted order.

What was NOT changed

  • $id URLs were not bumped (release-time only per spec).
  • The copilotTarget basePath discrepancy was left as-is: the schema intentionally documents basePath as unsupported for Copilot targets.
  • The apiProxy.auth OIDC block gap (config-file.ts has only anthropicTokenUrl, schema has 17 OIDC fields) was not touched — the schema is ahead of config-file.ts and no regression occurred.
  • audit.schema.json was not changed: userAgent, protocol, clientPort, destPort are firewall_detailed access-log fields only, not audit_jsonl fields; they do not appear in the audit.jsonl wire format.

Generated by Schema & Spec Sync · 196.6 AIC · ⌖ 17.2 AIC · ⊞ 5.6K ·

- schemas/token-usage.schema.json: add 5 optional budget fields written by
  mergeBudgetFields (effective_tokens_this_response, effective_tokens_total,
  model_multiplier, ai_credits_this_response, ai_credits_total). These fields
  are part of the wire format when apiProxy.maxEffectiveTokens or
  apiProxy.maxAiCredits is configured, confirmed by token-tracker.schema.test.js.

- docs/awf-config-spec.md §5: add missing apiProxy.maxCacheMisses →
  --max-cache-misses mapping row.

Triggered by commit 6de3216 (fix(api-proxy): 403 for terminal caps; fix
Anthropic/Copilot input credits).

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@lpcox lpcox marked this pull request as ready for review June 19, 2026 15:38
Copilot AI review requested due to automatic review settings June 19, 2026 15:38
@github-actions

github-actions Bot commented Jun 19, 2026

Copy link
Copy Markdown
Contributor Author

Documentation Preview

Documentation build failed for this PR. View logs.

Built from commit 0f5d809

@github-actions

github-actions Bot commented Jun 19, 2026

Copy link
Copy Markdown
Contributor Author

✅ Coverage Check Passed

Overall Coverage

Metric Base PR Delta
Lines 97.54% 97.58% 📈 +0.04%
Statements 97.47% 97.50% 📈 +0.03%
Functions 98.85% 98.85% ➡️ +0.00%
Branches 92.87% 92.91% 📈 +0.04%
📁 Per-file Coverage Changes (1 files)
File Lines (Before → After) Statements (Before → After)
src/workdir-setup.ts 92.7% → 94.5% (+1.82%) 92.7% → 94.5% (+1.82%)

Coverage comparison generated by scripts/ci/compare-coverage.ts

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates documentation artifacts (a JSON schema and a config spec doc) to better match the current AWF api-proxy implementation, specifically around token-usage record fields and CLI-to-config mappings.

Changes:

  • Extend schemas/token-usage.schema.json to document five optional budget-tracking fields emitted into token-usage JSONL records.
  • Add the missing apiProxy.maxCacheMisses--max-cache-misses <number> row to the normative CLI mapping table in docs/awf-config-spec.md.
Show a summary per file
File Description
schemas/token-usage.schema.json Documents additional optional budget-tracking fields emitted in token-usage JSONL records.
docs/awf-config-spec.md Adds missing CLI mapping row for apiProxy.maxCacheMisses.

Copilot's findings

Tip

Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

  • Files reviewed: 2/2 changed files
  • Comments generated: 1

Comment thread schemas/token-usage.schema.json
@github-actions

github-actions Bot commented Jun 19, 2026

Copy link
Copy Markdown
Contributor Author

✅ Copilot review passed with no inline comments.

@github-actions[bot] Add the ready-for-aw label to this PR to trigger agentic CI smoke tests.

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
@lpcox

lpcox commented Jun 19, 2026

Copy link
Copy Markdown
Collaborator

@copilot merge main

Copilot AI commented Jun 19, 2026

Copy link
Copy Markdown
Contributor

@copilot merge main

Merged main into this branch in 99902ff and verified the impacted tests still pass.

Copilot finished work on behalf of lpcox June 19, 2026 18:45
Copilot AI requested a review from lpcox June 19, 2026 18:45
@github-actions

github-actions Bot commented Jun 19, 2026

Copy link
Copy Markdown
Contributor Author

📡 Smoke OTel Tracing completed. All tracing scenarios validated. ✅

@github-actions

github-actions Bot commented Jun 19, 2026

Copy link
Copy Markdown
Contributor Author

Smoke Copilot BYOK AOAI (api-key) reports failed. AOAI BYOK (api-key) mode investigation needed...

@github-actions

github-actions Bot commented Jun 19, 2026

Copy link
Copy Markdown
Contributor Author

✨ The prophecy is fulfilled... Smoke Codex has completed its mystical journey. The stars align. 🌟

@github-actions

github-actions Bot commented Jun 19, 2026

Copy link
Copy Markdown
Contributor Author

🔌 Smoke Services — All services reachable! ✅

@github-actions

github-actions Bot commented Jun 19, 2026

Copy link
Copy Markdown
Contributor Author

📰 VERDICT: Smoke Copilot has concluded. All systems operational. This is a developing story. 🎤

@github-actions

github-actions Bot commented Jun 19, 2026

Copy link
Copy Markdown
Contributor Author

Smoke Copilot BYOK completed. Copilot BYOK mode operational. 🔓

@github-actions

github-actions Bot commented Jun 19, 2026

Copy link
Copy Markdown
Contributor Author

Chroot tests passed! Smoke Chroot - All security and functionality tests succeeded.

@github-actions

github-actions Bot commented Jun 19, 2026

Copy link
Copy Markdown
Contributor Author

Build Test Suite completed successfully!

@github-actions

github-actions Bot commented Jun 19, 2026

Copy link
Copy Markdown
Contributor Author

Contribution Check completed successfully!

@github-actions

Copy link
Copy Markdown
Contributor Author

🚀 Security Guard has started processing this pull request

@github-actions

github-actions Bot commented Jun 19, 2026

Copy link
Copy Markdown
Contributor Author

Smoke Claude failed

@github-actions

github-actions Bot commented Jun 19, 2026

Copy link
Copy Markdown
Contributor Author

Smoke Gemini completed. All facets verified. 💎

@github-actions

github-actions Bot commented Jun 19, 2026

Copy link
Copy Markdown
Contributor Author

Smoke Copilot BYOK AOAI (Entra) completed. Copilot AOAI BYOK (Entra) mode operational. 🔓

@github-actions

github-actions Bot commented Jun 19, 2026

Copy link
Copy Markdown
Contributor Author

🔑 Smoke Copilot PAT PAT auth validated. All systems operational. ✅

@github-actions

Copy link
Copy Markdown
Contributor Author

Smoke Test: Copilot BYOK (Direct Mode) ✅

Running in direct BYOK mode via api-proxy sidecar → api.githubcopilot.com

Test Results:

  • ✅ GitHub MCP connectivity
  • ✅ GitHub.com connectivity (HTTP 200)
  • ✅ File write/read verification
  • ✅ BYOK inference path active

Status: PASS

CC: @lpcox @Copilot

🔑 BYOK report filed by Smoke Copilot BYOK

@github-actions

Copy link
Copy Markdown
Contributor Author

🔬 Smoke Test Results

PR: docs: sync schemas and specs with source changes
Author: @github-actions[bot] | Reviewer: @lpcox

Test Result
GitHub MCP connectivity ✅ PASS
GitHub.com HTTP connectivity ❌ Pre-step data unavailable (template vars unresolved)
File write/read ❌ Pre-step data unavailable (template vars unresolved)

Overall: FAIL — Pre-computed step outputs were not injected (template variables unresolved). MCP connectivity confirmed working.

📰 BREAKING: Report filed by Smoke Copilot

@github-actions

Copy link
Copy Markdown
Contributor Author

🔬 Smoke Test: PAT Auth — PASS

Test Result
GitHub MCP connectivity ✅ PR listed successfully
GitHub.com HTTP ✅ 200
File write/read ✅ Content verified

Overall: PASS · Auth mode: PAT (COPILOT_GITHUB_TOKEN)

PR: docs: sync schemas and specs with source changes · Author: @github-actions · Reviewer: @lpcox

🔑 PAT report filed by Smoke Copilot PAT

@github-actions

Copy link
Copy Markdown
Contributor Author

Smoke Test Results

Overall status: FAIL

Warning

Firewall blocked 1 domain

The following domain was blocked by the firewall during workflow execution:

  • localhost

To allow these domains, add them to the network.allowed list in your workflow frontmatter:

network:
  allowed:
    - defaults
    - "localhost"

See Network Configuration for more information.

💎 Faceted by Smoke Gemini

@github-actions

Copy link
Copy Markdown
Contributor Author

✅ "chore: upgrade gh-aw to v0.80.6 and recompile workflows"
✅ "fix(api-proxy): 403 for terminal caps; fix Anthropic/Copilot input credits"
✅ "GitHub · Change is constant. GitHub keeps you ahead. · GitHub"
✅ "Smoke test passed for Codex at Fri Jun 19 19:22:52 UTC 2026"
✅ "npm ci && npm run build"
Overall status: PASS

Warning

Firewall blocked 1 domain

The following domain was blocked by the firewall during workflow execution:

  • registry.npmjs.org

To allow these domains, add them to the network.allowed list in your workflow frontmatter:

network:
  allowed:
    - defaults
    - "registry.npmjs.org"

See Network Configuration for more information.

🔮 The oracle has spoken through Smoke Codex

@github-actions

Copy link
Copy Markdown
Contributor Author

Chroot Version Comparison Results

Runtime Host Version Chroot Version Match?
Python Python 3.12.13 Python 3.12.3
Node.js v24.16.0 v22.22.3
Go go1.22.12 go1.22.12

Result: ❌ Not all tests passed — Python and Node.js versions differ between host and chroot environments.

Tested by Smoke Chroot

@github-actions

Copy link
Copy Markdown
Contributor Author

🔭 Smoke Test: API Proxy OpenTelemetry Tracing

Scenario Result Detail
1 · Module Loading ✅ Pass otel.js loads cleanly; exports startRequestSpan, setTokenAttributes, setBudgetAttributes, endSpan, endSpanError, shutdown, isEnabled + test helpers. isEnabled()true (file fallback active).
2 · Test Suite ✅ Pass 59 / 59 tests passed, 0 failures across otel.test.js + otel-fanout.test.js (2 suites, 2.2 s).
3 · Env Var Forwarding ✅ Pass src/services/api-proxy-service-config.ts forwards GH_AW_OTLP_ENDPOINTS, OTEL_EXPORTER_OTLP_ENDPOINT, OTEL_EXPORTER_OTLP_HEADERS, GITHUB_AW_OTEL_TRACE_ID, GITHUB_AW_OTEL_PARENT_SPAN_ID, and OTEL_SERVICE_NAME (default awf-api-proxy) into the api-proxy container.
4 · Token Tracker Integration ✅ Pass onUsage callback exists in token-tracker-http.js (line 374 JSDoc + lines 283/324 invocation). Acts as the hook point where setTokenAttributes / setBudgetAttributes attach gen_ai.usage.* semconv attributes to the span.
5 · OTEL Diagnostics ✅ Pass (local fallback) No OTLP endpoint configured in this run — spans fall back to /var/log/api-proxy/otel.jsonl (file exporter). No spans lost; graceful degradation confirmed.

All scenarios pass.

📡 OTel tracing validated by Smoke OTel Tracing

@github-actions

Copy link
Copy Markdown
Contributor Author

@lpcox

  • GitHub MCP connectivity: ✅
  • GitHub.com connectivity: ✅
  • File write/read test: ✅
  • BYOK inference: ✅

Running in direct BYOK mode (AWF_AUTH_TYPE=github-oidc + AWF_AUTH_AZURE_* + COPILOT_PROVIDER_BASE_URL) via api-proxy → Azure OpenAI (Foundry, o4-mini-aw) authenticated via Microsoft Entra

Overall: PASS

🪪 BYOK (AOAI Entra) report filed by Smoke Copilot BYOK AOAI (Entra)

@github-actions

Copy link
Copy Markdown
Contributor Author

🏗️ Build Test Suite Results

Ecosystem Project Build/Install Tests Status
Bun elysia 1/1 passed ✅ PASS
Bun hono 1/1 passed ✅ PASS
C++ fmt N/A ✅ PASS
C++ json N/A ✅ PASS
Deno oak N/A 1/1 passed ✅ PASS
Deno std N/A 1/1 passed ✅ PASS
.NET hello-world N/A ✅ PASS
.NET json-parse N/A ✅ PASS
Go color 1/1 passed ✅ PASS
Go env 1/1 passed ✅ PASS
Go uuid 1/1 passed ✅ PASS
Java gson 1/1 passed ✅ PASS
Java caffeine 1/1 passed ✅ PASS
Node.js clsx all passed ✅ PASS
Node.js execa all passed ✅ PASS
Node.js p-limit all passed ✅ PASS
Rust fd 1/1 passed ✅ PASS
Rust zoxide 1/1 passed ✅ PASS

Overall: 8/8 ecosystems passed — ✅ PASS

Generated by Build Test Suite for issue #5283 · 34.3 AIC · ⊞ 7.7K ·

@github-actions

Copy link
Copy Markdown
Contributor Author

Smoke Test Results — FAIL

Check Result
Redis PING ❌ Connection timed out
PostgreSQL pg_isready ❌ No response
PostgreSQL SELECT 1 ❌ Connection timed out

host.docker.internal resolves to 172.17.0.1 but service containers are unreachable on ports 6379 and 5432.

Overall: FAIL

🔌 Service connectivity validated by Smoke Services

@lpcox lpcox merged commit 1c12102 into main Jun 19, 2026
88 of 90 checks passed
@lpcox lpcox deleted the docs/schema-sync-2026-06-19-f44e522d16eacfb9 branch June 19, 2026 20:50
github-actions Bot added a commit that referenced this pull request Jun 22, 2026
PRs #5279 and #5283 both added `apiProxy.maxCacheMisses` to Section 5
of the spec within 20 seconds of each other, creating a duplicate entry
in the CLI mapping table.

Removes the redundant second entry (after maxPermissionDenied), keeping
the correct placement between maxModelMultiplierCap and maxPermissionDenied
that PR #5283 added.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
lpcox pushed a commit that referenced this pull request Jun 22, 2026
…5387)

PRs #5279 and #5283 both added `apiProxy.maxCacheMisses` to Section 5
of the spec within 20 seconds of each other, creating a duplicate entry
in the CLI mapping table.

Removes the redundant second entry (after maxPermissionDenied), keeping
the correct placement between maxModelMultiplierCap and maxPermissionDenied
that PR #5283 added.

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants